//
//  XHF_WebViewController.m
//  haojia
//
//  Created by 徐宏飞 on 16/5/17.
//  Copyright © 2016年 徐宏飞. All rights reserved.
//

#import "XHF_WebViewController.h"

@interface XHF_WebViewController ()<UIWebViewDelegate>

@end

@implementation XHF_WebViewController

- (void)initNavigationBar
{
    self.enableReturnButton = YES;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
    //webView
    NSURL *url = [NSURL URLWithString:self.url];
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    UIWebView *webView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    webView.delegate = self;
    [webView loadRequest:request];
    [self.view addSubview:webView];
    
    
    
    
}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [GiabHUD hideUIBlockingIndicator];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [GiabHUD showUIBlockingIndicatorWithText:@"正在加载..."];
}


- (void)webViewDidStartLoad:(UIWebView *)webView{
    
}


- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [GiabHUD hideUIBlockingIndicator];
}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    [GiabHUD hideUIBlockingIndicator];
    
//    [self showAlertWithTitle:nil message:@"网络获取失败!" cancelButtonTitle:@"取消" otherButtonTitles:@"确定"];
//    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
